package com.ctrip.study.refactor.replaceTempWithQuery;

public class Order {
	
	private int _quantity;
	
	private int _itemPrice;
	
	public Order(int _quantity, int _itemPrice) {
		this._quantity = _quantity;
		this._itemPrice = _itemPrice;
	}

	double getPrice() {
		return basePrice() * discountFactor();
	}

	private double discountFactor() {
		if (basePrice() > 1000)
			return 0.95;
		return 0.98;
	}

	private int basePrice() {
		return _quantity * _itemPrice;
	}

}
